<template>
  <div class="printForm">
    <div class="area-header">
      <span class="area-header-title">{{ $t('申请单') }}</span>
    </div>
    <table class="printTable">
      <tr>
        <td class="tit">{{ $t('流程标题') }}</td>
        <td colspan="3"> {{ form.actTitle }}</td>
      </tr>
      <tr>
        <td class="tit">{{ $t('姓名') }}</td>
        <td>{{ form.name }}</td>
        <td class="tit">{{ $t('证件类型') }}</td>
        <td>
          <dictSelect
            v-model="form.idType"
            :clearable="true"
            dictionary="hr_id_type"
          />
        </td>
      </tr>
      <tr>
        <td class="tit">{{ $t('证件号码') }}</td>
        <td>{{ form.idNum }}</td>
        <td class="tit">{{ $t('性别') }}</td>
        <td>
          <dictSelect
            v-model="form.sex"
            :clearable="true"
            dictionary="sys_user_sex"
          />
        </td>
      </tr>
      <tr>
        <td class="tit">{{ $t('年龄') }}</td>
        <td>{{ form.age }}</td>
        <td class="tit">{{ $t('学历') }}</td>
        <td>{{ form.education }}</td>
      </tr>
      <tr>
        <td class="tit">{{ $t('学校') }}</td>
        <td>{{ form.school }}</td>
        <td class="tit">{{ $t('专业') }}</td>
        <td>{{ form.major }}</td>
      </tr>
      <tr>
        <td class="tit">{{ $t('到职日期') }}</td>
        <td>{{ parseTime(form.entryTime) }}</td>
        <td class="tit">{{ $t('实际部门') }}</td>
        <td> <DeptSelect v-model="form.deptId" /></td>
      </tr>
      <tr>
        <td class="tit">{{ $t('实际职位') }}</td>
        <td>{{ form.postNames }}</td>
        <td class="tit">{{ $t('薪资福利（月薪）')+$t('金额单位') }}</td>
        <td> {{ moneyFormat(form.salary, 'w') }}</td>
      </tr>
      <tr>
        <td class="tit">{{ $t('合同期限') }}</td>
        <td>
          <dictSelect
            v-model="form.contractTerm"
            :clearable="true"
            dictionary="hr_contract_period"
          />
        </td>
        <td class="tit">{{ $t('试用期') }}</td>
        <td>  <dictSelect
          v-model="form.probation"
          :clearable="true"
          dictionary="hr_trial_type"
        /></td>
      </tr>
      <tr>
        <td class="tit">{{ $t('试用期薪资（月薪）')+$t('金额单位') }}</td>
        <td> {{ moneyFormat(form.probationSalary, 'w') }}</td>
        <td class="tit">{{ $t('转正日期') }}</td>
        <td> {{ parseTime(form.becomeTime) }}</td>
      </tr>

      <tr>
        <td class="tit">{{ $t('对工作总结') }}</td>
        <td colspan="3">
          {{ form.summary }}
        </td>
      </tr>
      <tr>
        <td class="tit">{{ $t('工作建议') }}</td>
        <td colspan="3">
          {{ form.proposal }}
        </td>
      </tr>

    </table>

    <!-- 附件列表 -->
    <FileView :list.sync="form.fileList" data-type="hr_become" :btn-show="!otherBtnHide" />

  </div>

</template>

<script>
import { getHrBecomeWork } from '@/api/oa/hr/hrBecomeWork'
export default {
  components: {
  },
  data() {
    return {
      otherBtnHide: false,
      form: {
        fileList: []
      },
      buttonShow: true
    }
  },
  created() {
    this.$bus.$emit('async_done')
  },
  methods: {
    // 初始化数据
    init(data) {
      if (data != null && data.id !== undefined) {
        getHrBecomeWork(data.id).then(response => {
          this.form = response.data
        })
      }
    }
  }
}
</script>
